<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>PC模板页面</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="refresh" content="1200">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--插件样式-->
    <link rel="stylesheet" href="/dist/plugins/fixedTable/fixed-table.css"/>
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=39cd89cd">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=16f1e6f3">
    <style>
        .table > tbody > tr > td {
            height: 24px;
            max-height: 24px;
            overflow: hidden;
            position: relative;
        }
        .moduleName {
            float: left;
            height: 27px;
            line-height: 27px;
            font-size: 22px;
            width: 100px;
            text-align: center;
        }

        .tryStyle {
            width: 30px;
            height: 14px;
            line-height: 14px;
            font-size: 12px;
            /* top: 0; */
            right: 0;
            position: absolute;
            border-radius: 5px;
            margin-top: 1px;
            background: red;
            color: #fff;
            margin-right: -2px;
            transform: scale(0.8);
        }

        .nav-tabs-custom {
            margin-bottom: 0;
            box-shadow: none;
            position: relative;
        }

        span.lineOne {
            line-height: 27px !important;
            height: 28px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .table-detail td.twoLine {
            line-height: 1.5 !important;
            padding: 3px 0 !important;
        "
        }

        .table-detail select {
            text-indent: 0 !important;
            padding-left: 0 !important;
            margin-left: -4px !important;
        }

        .fixed-table_body tr td {
            border-right: none;
            font-size: 12px;
            text-align: center;
        }

        .fixed-table_header tr th {
            border-right: none;
            background: yellow;
            font-weight: normal;
            font-size: 12px;
        }

        .fixed-table_body tr:nth-of-type(odd) {
            background: #F9F9F9;
        }

        .gray td {
            color: #CCCCCC !important;
        }

        .fixed-table-box {
            border: 1px solid #cbcbcd;
        }

        .fixed-table-box td {
            position: static;
        }

        :after, :before {
            background-color: transparent !important;
        }
    </style>
</head>
<body>
<section class="content" id="app">
    <iframe id="ifExprot" style="width:0px;height:0px;display: none;" frameborder="0"></iframe>
    <div class="div-td-content-more"><i></i></div>
    <div class="oaLoad">
        <div class="loadGif" id="areaProgress"></div>
    </div>
    <div class="box-body no-padding iframeH" style="overflow: auto;" id="scrollDiv">
        <div id="progress" class="wyui-progress"></div>
        <div class="fixed-table-box head-fixed " style="border: 0px">
            <div class="fixed-table_header-wraper">
                <table class="fixed-table_header" cellspacing="0" cellpadding="0" border="0">
                    <thead>
                    <tr>
                        <th style="width:80px;">
                            <div class="table-cells">公司</div>
                        </th>
                        <th style="width:60px;">
                            <div class="table-cells">部门</div>
                        </th>
                        <th style="width:80px;">
                            <div class="table-cells">职位</div>
                        </th>
                        <th style="width:60px;">
                            <div class="table-cells">姓名</div>
                        </th>
                        <th  class='tableTitle' style="width: 10px">
                        </th>

                    </tr>

                    </thead>
                </table>
            </div>
            <div class="fixed-table_body-wraper iframeH2">
                <table class=" " cellspacing="0" cellpadding="0" border="0"
                       style="width: 100%;">
                    <tbody id="tbList">
                    <template v-if="list.main.length>0">
                        <tr v-for="(item,i) in list.main">
                            <td style="width:80px;text-align: center;" :rowspan="item.companyNamespan"
                                :class="{hidden: item.companyNamedis}">{{item.companyName}}
                            </td>
                            <td style="width:60px;text-align: center;" :rowspan="item.departNamespan"
                                :class="{hidden: item.departNamedis}">{{item.departName}}
                            </td>
                            <td style="width:80px;text-align: center;" :rowspan="item.roleNamespan" :class="{hidden: item.roleNamedis}">{{item.roleName}}</td>
                            <td style="width:60px;text-align: center;" >{{item.name}}
                            </td>

                            <template v-if="list.main.length>=18">
                                <td style="width: 0px;"></td>
                            </template>
                            <template v-else>
                                <td style="width: 10px;border-left: 0px;border-right: 1px solid #cbcbcd;"></td>
                            </template>
                        </tr>
                    </template>
                    <tr v-else>
                        <td colspan="4" style="width:50px;text-align: center;" v-if="state==1">暂无投票人员</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>

    </div>
    <!--<div class="oa-pager text-center" style="margin-top: 5px;">-->
    <!--共-->
    <!--<span id="allCount"> 0 </span>条记录&nbsp;&nbsp;&nbsp;-->
    <!--<span id="nowPage"> 1 </span>/<span id="allPage">1</span>&nbsp;&nbsp;&nbsp;-->
    <!--<span class="oa-pager-button" id="first">首页</span>-->
    <!--<span class="oa-pager-button" id="prev">上一页</span>-->
    <!--<span class="oa-pager-button" id="next">下一页</span>-->
    <!--<span class="oa-pager-button" id="last">尾页</span>-->
    <!--</div>-->
</section>


<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=7e54a132"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=558d0414"></script>

<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script src="/dist/plugins/select2/select2.full.min.js"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script src="/dist/plugins/fixedTable/fixed-table.js"></script>

<script>
    $(function () {
        $("body").on("click", ".lineOne,.lineTwo", function (e) {
            if ($(".div-td-content-more").is(":hidden")) {
                var text = $(this).text();
                if (text != "") {
                    text = "<i></i>" + text;
                    $(".div-td-content-more").html(text).css({
                        "width": $(this).outerWidth() + 12 + "px",
                        "left": $(this).offset().left - 6,
                        "top": ($(this).offset().top + $(this).outerHeight()) + "px"
                    }).show();
                    e.stopPropagation();
                }
            } else {
                $(".div-td-content-more").hide();
            }
        });
        $("body").on("click", ".div-td-content-more", function (e) {
            e.stopPropagation();
        });
        $("body").on("click", function () {
            $(".div-td-content-more").hide();
        });
    });
</script>
<script type="text/javascript">
    var app = new Vue({
        el: '#app',
        data: {
            examState: $.wyui.page.urlParams.examState ? $.wyui.page.urlParams.examState : '',
            id: $.wyui.page.urlParams.id ? $.wyui.page.urlParams.id : '',
            userIds:$.wyui.page.urlParams.userIds,
            list: {
                main: [],
            },
            state: 1,

        },
        methods: {
            //合并单元格
            tablesMergeCell: function (list) {
                for (field in list[0]) {
                    var k = 0;
                    while (k < list.length) {
                        list[k][field + 'span'] = 1;
                        list[k][field + 'dis'] = false;
                        for (var i = k + 1; i <= list.length - 1; i++) {
                            if (list[k][field] == list[i][field] && list[k][field] != '') {
                                if (field == 'departName') {
                                    if (list[k].companyName == list[i].companyName) {
                                        list[k][field + 'span']++;
                                        list[k][field + 'dis'] = false;
                                        list[i][field + 'span'] = 1;
                                        list[i][field + 'dis'] = true;
                                    }
                                } else if (field == 'roleName') {
                                    if (list[k].companyName == list[i].companyName && list[k].departName == list[i].departName) {
                                        list[k][field + 'span']++;
                                        list[k][field + 'dis'] = false;
                                        list[i][field + 'span'] = 1;
                                        list[i][field + 'dis'] = true;
                                    }
                                } else {
                                    list[k][field + 'span']++;
                                    list[k][field + 'dis'] = false;
                                    list[i][field + 'span'] = 1;
                                    list[i][field + 'dis'] = true;
                                }
                            } else {
                                break;
                            }
                        }
                        k = i;
                    }
                }
                return list;
            }
            /*lookUser:function () {
             var that=this;
             that.lookUserModel=true;
             var param = {
             enableNavigateBack: false,
             }

             $.wyui.postMethod('/vote/lookUserList.json', {userIds: that.info.voteUsers}, function (data) {
             that.lookUserList= that.tablesMergeCell(data.List);
             that.hideLoading();
             })
             }*/
        },
        mounted:function (){
            var that=this;//声明一个变量指向Vue实例this，保证作用域一致
            this.title='页面一进入执行'
            var date='';
            console.log(that.id)
            console.log(that.userIds)
            /* $.wyui.postMethod("/vote/getVoteDetail.json", {id:that.id}, function (info) {
             date=info.main.voteUsers;
             console.log(date)
             });*/
             $.wyui.postMethod("/vote/lookUserList.json", {userIds: that.userIds}, function (data) {
              that.list.main=that.tablesMergeCell(data.List);
              console.log(that.list.main)
             })
        }

    })
</script>

</body>
</html>